package com.anxin.registerManagement.controller;

import com.anxin.registerManagement.bean.jo.LogSearchJo;
import com.anxin.registerManagement.service.LogService;
import com.anxin.registerManagement.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 叶前呈
 * @date 2022/3/27 13:40
 */
@Api("日志接口")
@RestController
@RequestMapping("/logs")
public class LogController {

    private static final Logger LOGGER = LoggerFactory.getLogger(LogController.class);

    @Autowired
    LogService logService;

    @ApiOperation("查询日志")
    @PostMapping("/search")
    public ResultUtil searchLog(@RequestBody LogSearchJo logSearchJo) {
        LOGGER.info("查询日志：{}", logSearchJo);
        return ResultUtil.success(logService.searchLog(logSearchJo));
    }
}
